package seritest;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import java.io.*;

import org.junit.Test;

public class TestSeri {
	@Test
	public void testWrite() throws IOException, ClassNotFoundException {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		ObjectOutputStream out = new ObjectOutputStream(bos);

		out.writeObject(new TestClass());
		out.putFields().put("abc", 3);

		ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()));

		int b = ois.readFields().get("abc", 3);
		assertThat(b, is(3));
	}
}
